﻿@page "/"
@using MessageBoxControl.Controls.MessageBox
@inject MessageBoxControl.Controls.MessageBox.MessageBoxService MessageBoxService

<h1>Message Box</h1>

<TelerikButton OnClick="@ShowMessageBox">Show confirmation message box</TelerikButton>

@code {
    private string MessageBoxResult { get; set; } = "?";
    private void ShowMessageBox()
    {
        MessageBoxService.Show("Confirmation", "Are you really sure you want to delete this record ?", MessageBoxButtonTypeEnum.YesNo, (result) =>
        {
            if (result == MessageBoxResultEnum.Yes)
            {
                MessageBoxService.Show("Information", "Record deleted", MessageBoxButtonTypeEnum.OK, null);
            }
        });
    }
}